<template>
  <div class="user">
    <!-- 面包屑导航-->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/home' }">树结构</el-breadcrumb-item>
      <el-breadcrumb-item>树结构</el-breadcrumb-item>
      <el-breadcrumb-item>树结构</el-breadcrumb-item>
    </el-breadcrumb>

    <el-card>
      <!-- 树结构 EEEE  end-->
      <el-tree :props="props" :load="loadNode" lazy show-checkbox> </el-tree>
      <!-- 树结构 EEEEend -->
    </el-card>
  </div>
</template>
<script>
export default {
  data() {
    return {
      queryinfo: {
        type: 1,
        pagenum: 1,
        pagesize: 10
      },
      props: {
        label: 'name',
        children: 'zones',
        isLeaf: 'leaf'
      }
    }
  },
  methods: {
    //获取用户列表
    getUsers() {
      this.$http
        .get('categories', { params: this.queryInfo })
        .then(result => {
          if (result.data.meta.status != 200) return this.$message.err('获取信息失败')
          console.log(result.data.daata)
          // this.userList = result.data.data.users
          //this.total = result.data.data.total
        })
        .catch(err => {
          console.log(err)
        })
    },
    //获取节点
    loadNode(node, resolve) {
      if (node.level === 0) {
        return resolve([{ name: 'region' }])
      }
      if (node.level > 1) return resolve([])
    }
  },
  created() {
    this.getUsers()
  }
}
</script>
<style lang="less" scoped></style>
